import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import path from 'path';

export default defineConfig({
  plugins: [vue()],
  build: {
    rollupOptions: {
      input: {
        main: resolve(__dirname, 'index.html'),  // 主页
     
      }
    }
  },resolve: {
    alias: {
      '@': path.resolve(__dirname, './src') // ⬅️ 配置 @ 为 src 路径
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080', // 后端服务地址
        changeOrigin: true,
      },
    },
  }
})